from plyfile import PlyData
import os
import numpy as np
model_path = os.path.join('/home/sunh/6D_ws/other_code/EfficientPose/Linemod_preprocessed/models/obj_00.ply')
ply = PlyData.read(model_path)
data = ply.elements[0].data
x = data['x']
y = data['y']
z = data['z']
x_size = np.max(x)-np.min(x)
y_size = np.max(y)-np.min(y)
z_size = np.max(z)-np.min(z)
print(np.min(x))   # MIN X
print(np.max(x)-np.min(x)) # X SIZE 下面同理
print('-----------------------------------------------------------------')
print(np.min(y))
print(np.max(y)-np.min(y))
print('-----------------------------------------------------------------')
print(np.min(z))
print(np.max(z)-np.min(z))
print('-----------------------------------------------------------------')
print( np.sqrt(x_size**2 + y_size**2 + z_size**2) ) #直径
